<?php

use yii\helpers\Url;
use backend\assets\AppAsset;
use common\models\Article;
AppAsset::addCss($this , "/plugins/bootstrap-sweetalert/sweet-alert.css");
AppAsset::addScript($this , "/plugins/bootstrap-sweetalert/sweet-alert.min.js");
AppAsset::addScript($this , "/js/app.js");
$this->title = '编辑导航';
$request = Yii::$app->request->post();
?>
<div class="panel">
    <div class="panel-body">
        <div class="row">
            <div class="col-sm-12">
                <div class="card-box">
                    <h4 class="m-t-0 header-title"><b>编辑导航</b></h4>
                    <p class="text-muted font-13 m-b-30">
                        爱生活、爱分享、爱编程！
                    </p>
                    <form action="<?=Url::toRoute('nav/save')?>" method="post" enctype="multipart/form-data">
                        <input type="hidden" name="id" value="<?=isset($model['id']) ? $model['id'] : ''?>">
                        <input type="hidden" name="<?=Yii::$app->request->csrfParam?>" value="<?=Yii::$app->request->csrfToken?>">
                        <div class="form-group">
                            <label>标题</label>
                            <input type="text" name="title" placeholder="导航标题" value="<?=isset($model['title']) ? $model['title'] : ''?>" class="form-control">
                        </div>
                        <div class="form-group">
                            <label>网址</label>
                            <input type="text" name="url" placeholder="/site/index" value="<?=isset($model['url']) ? $model['url'] : ''?>" class="form-control">
                        </div>
                        <div class="form-group">
                            <label>描 述</label>
                            <textarea class="form-control" name="desc" placeholder="描述：这是一个神奇的网站"><?=isset($model['desc']) ? $model['desc'] : ''?></textarea>
                        </div>
                        <div class="radio radio-primary radio-inline">
                            <input <?=isset($model['status']) && $model['status'] == 0 ? 'checked' : ''?> type="radio" value="0" name="status"><label>隐藏</label>
                        </div>
                        <div class="radio radio-primary radio-inline">
                            <input <?=isset($model['status']) && $model['status'] == 1 ? 'checked' : ''?> type="radio" value="1" name="status"><label>显示</label>
                        </div>
                        <div class="form-group text-right m-b-0">
                            <button class="btn btn-primary waves-effect waves-light" type="submit">
                                提 交
                            </button>
                            <button onclick="location.href='<?=Url::toRoute('/nav')?>'" type="button" class="btn btn-default waves-effect waves-light m-l-5">
                                返 回
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
